package org.poem.controllerAdvice;

import org.poem.entity.DemoObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by poem on 2017/8/29.
 */
@Controller
@RequestMapping("/adviceController")
public class AdviceController {

    @RequestMapping("/advice")
    @ResponseBody
    public String getSome(@ModelAttribute("msg") String msg, DemoObject object){
        throw new IllegalArgumentException("非常抱歉，参数有误，来自@ModelAttribute:"+msg );
    }
}
